<template>
  <div style="height: 765px;"><!--border: 1px solid darkblue"-->

    <!--主体内容-->
    <el-row :gutter="0" style="background:white;border-bottom: 1px solid red;margin: -20px;text-align: left;height: 40px;line-height: 40px">
      <el-col :span="24" :offset="0" style="">
        <el-button type="text" @click="goback"><  增加收款账户</el-button>
      </el-col>
    </el-row>


    <!--<el-card class="box-card" style="margin-top: 40px;text-align: left">
      <el-row :gutter="0" >
        <el-col :span="5" :offset="0" style="">
          银行名称
        </el-col>
        <el-col :span="12" :offset="2" style="border-bottom: 1px solid black">
          {{backName}}
        </el-col>
      </el-row>
      <el-row :gutter="0" style="margin-top: 10px">
        <el-col :span="5" :offset="0" style="">
          银行卡号
        </el-col>
        <el-col :span="12" :offset="2" style="border-bottom: 1px solid black">
          {{backNo}}
        </el-col>
      </el-row>
    </el-card>-->


    <el-collapse accordion style="margin-top: 20px;">
      <el-collapse-item>
        <template slot="title">
          添加银行卡？<i class="header-icon el-icon-info"></i>
        </template>

        <el-form ref="form" :model="form" label-width="80px" style="margin-top: 20px;padding-right: 20px;">
          <el-form-item label="银行名称">
            <el-input v-model="form.banknameLoan"></el-input>
          </el-form-item>
          <el-form-item label="银行卡号">
            <el-input v-model="form.bankcardnoLoan"></el-input>
          </el-form-item>

          <el-form-item>
            <el-button type="primary" @click="onSubmit">立即添加</el-button>
            <el-button @click="goback">取消</el-button>
          </el-form-item>
        </el-form>
      </el-collapse-item>
    </el-collapse>



  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    name: "gathering",
    data() {
      return {
        backName: '',
        backNo: '',
        form: {}
      };
    },
    methods: {
      goback:function(){
        this.$router.push("/borrowReal")
      },
      onSubmit() {
        axios.post("http://localhost:9999/credit-borrower/addAccount",{banknameLoan:this.form.banknameLoan,bankcardnoLoan:this.form.bankcardnoLoan}).then(res=>{
            if(res.data=="success"){
              alert("添加成功")
              this.$router.push("/borrowReal")
            }else {
              alert("失败")
            }
        })
      },
    },
    mounted:{

    }
  }
</script>

<style scoped>

</style>
